import sys
sys.path.append("../")
import unittest
from codes.LightPath import *

class LightPathTest(unittest.TestCase):
    """
    测试LightPath模块
    """

    def test_addLP(self):
        lpLL = LightPathLinkList()
        lp1 = LightPathNode([1,1], -30)
        lp2 = LightPathNode([2,2], 60)
        lpLL.addLP(lp1)
        lpLL.addLP(lp2)
        self.assertEqual(lpLL.head.angle, -30)
        self.assertEqual(lpLL.head.nextLP.angle, 60)

if __name__ == "__main__":
    unittest.main(verbosity=2)
